<SCRIPT>

  var date_arr = new Array;
  var days_arr = new Array;

  date_arr[0]=new Option("January","01");
  date_arr[1]=new Option("February","02");
  date_arr[2]=new Option("March","03");
  date_arr[3]=new Option("April","04");
  date_arr[4]=new Option("May","05");
  date_arr[5]=new Option("June","06");
  date_arr[6]=new Option("July","07");
  date_arr[7]=new Option("August","08");
  date_arr[8]=new Option("September","09");
  date_arr[9]=new Option("October","10");
  date_arr[10]=new Option("November","11");
  date_arr[11]=new Option("December","12");

  function fill_select(f)
  {
    document.writeln("<SELECT class=\"cMonth\" name=\"months\" onchange=\"update_days(customerForm)\">");
    for(x=0;x<12;x++)
    {
      document.writeln("<OPTION value=\""+date_arr[x].value+"\">"+date_arr[x].text+"</OPTION>");
    }
    document.writeln("</SELECT>&nbsp;<SELECT class=\"cDay\" name=\"days\"></SELECT>&nbsp;");
    selection = getNumberOfDays(f.months[f.months.selectedIndex].value);
  }

  function update_days(f)
  {
    temp=f.days.selectedIndex;
    for(x=days_arr.length;x>0;x--)
    {
      days_arr[x]=null;
      f.days.options[x]=null;
    }
    selection=parseInt(getNumberOfDays(f.months[f.months.selectedIndex].value));
    ret_val = 0;
    if(f.months[f.months.selectedIndex].value == "02")
    {
      year=parseInt(f.years.options[f.years.selectedIndex].value);
      if (year % 4 != 0 || year % 100 == 0 )
      {
        ret_val = 0;
      }
      else
      {
        if (year % 400 == 0)
        {
          ret_val = 0;
        }
        else
        {
          ret_val = 1;
        }
	  }
    }
    selection = selection + ret_val;
    for(x=1;x < selection+1;x++)
    {
      if(x > 0 && x < 10)
      {
        days_arr[x-1]=new Option('0'+x);
        f.days.options[x-1]=days_arr[x-1];
      }
      else
      {
        days_arr[x-1]=new Option(x);
        f.days.options[x-1]=days_arr[x-1];
	  }
    }
    if (temp == -1)
    {
      f.days.options[0].selected=true;
    }
    else
    {
      f.days.options[temp].selected=true;
    }
  }

  function year_install(f)
  {
    var a = new Date();
    document.writeln("<SELECT class=\"cYear\" name=\"years\" onchange=\"update_days(customerForm)\">")
    for(x=1900;x <= a.getYear();x++)
    {
      document.writeln("<OPTION value=\""+x+"\">"+x+"</OPTION>");
    }
    document.writeln("</SELECT>");
    update_days(f);
  }

  function getNumberOfDays(month)
  {
	if(month == "02")
    {
      return 28;
    }
    else if(month == "01" || month == "03" || month == "05" || month == "07" || month == "08" || month == "10" || month == "12")
    {
      return 31;
    }
	else
    {
      return 30;
    }
  }

</SCRIPT>